<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        background-color: #f00;
        transition: all 0.5s;
      }
      .active {
        width: 200px;
        background-color: #00f;
      }
      .box:not(.active) {
        width: 600px;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <button @click="bol=!bol">点我啊</button>
      <div class="box" :class="{active:bol}">123456</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          bol: false,
        },
      });
    </script>
  </body>
</html>
